package xin.marcher.module.label.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import xin.marcher.module.common.core.PageResult;
import xin.marcher.module.label.domain.dto.LabelDTO;
import xin.marcher.module.label.domain.dto.LabelResultDTO;
import xin.marcher.module.label.domain.request.LabelRequest;
import xin.marcher.module.label.domain.request.QueryLabelRequest;
import xin.marcher.module.label.repository.LabelRepository;
import xin.marcher.module.label.service.LabelService;

/**
 *
 */
@Service
public class LabelServiceImpl implements LabelService {

    @Autowired
    private LabelRepository labelRepository;

    @Override
    public LabelResultDTO saveLabel(LabelRequest request) {
        Long id = labelRepository.saveLabel(request);
        return new LabelResultDTO(id, true);
    }

    @Override
    public PageResult<LabelDTO> queryLabelPage(QueryLabelRequest request) {
        return labelRepository.queryLabelPage(request);
    }

}
